﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Xml.Linq;

namespace Frame.Lib.Core.Cache.Paras
{
    public class ParasContainer 
    {
        public Hashtable KeyValues
        {
            get;
            set;
        }

        public string this[string key]
        {
            get
            {
                return (string)this.KeyValues[key];
            }
            set
            {
                this.KeyValues[key] = value;
            }
        }



        public override string ToString()
        {
            XElement root = new XElement("ParasContainer");

            foreach (string key in KeyValues.Keys)
            {
                XElement ele = new XElement("paras");
                ele.Add(new XAttribute("key", key));
                ele.Add(new XAttribute("Value", KeyValues[key].ToString()));

                root.Add(ele);
            }

            return root.ToString();
        }
    }
}
